package com.woniuxy.sender;

import com.woniuxy.entity.Product;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author: 曾令忠
 * @Description:
 * @Date: 2020/7/6 0006-上午 11:07
 */
@Component
public class ProductSender {
    @Autowired
    RabbitTemplate rabbitTemplate;

    public void send(Product product){
        System.out.println("商户模块向商户模块发送请求");
        rabbitTemplate.convertAndSend("rpc_exchange_b","",product);
    }
}
